<div>
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>
                        <span><vc:i18n name="强制回单" namespace="constrainFinishRepair"></vc:i18n></span>
                    </h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row" v-if="constrainFinishRepairInfo.repairObjType != '004'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="是否用料" namespace="constrainFinishRepair"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="constrainFinishRepairInfo.maintenanceType">
                                        <option selected value="">
                                            {{vc.i18n('请选择是否用料','constrainFinishRepair')}}
                                        </option>
                                        <option v-for="(item,index) in constrainFinishRepairInfo.maintenanceTypes"
                                                :key="index" :value="item.statusCd"
                                                v-if="item.statusCd != '1001' && item.statusCd != '1002'">
                                            {{item.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row" v-if="constrainFinishRepairInfo.repairObjType == '004'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="维修类型" namespace="constrainFinishRepair"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="constrainFinishRepairInfo.maintenanceType">
                                        <option selected value="">
                                            {{vc.i18n('请选择维修类型','constrainFinishRepair')}}
                                        </option>
                                        <option v-for="(item,index) in constrainFinishRepairInfo.maintenanceTypes"
                                                :key="index" :value="item.statusCd"
                                                v-if="item.statusCd != '1003' && item.statusCd != '1004'">
                                            {{item.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row"
                                 v-if="constrainFinishRepairInfo.maintenanceType == '1001' || constrainFinishRepairInfo.maintenanceType == '1003'">
                                <label class="col-sm-2 col-form-label">&nbsp;</label>
                                <div class="col-sm-10">
                                    <button class="btn btn-primary" type="button"
                                            v-on:click="_openChooseSingleResourceModel()">
                                        <i class="fa fa-plus"></i>&nbsp;选择商品
                                    </button>
                                </div>
                            </div>
                            <div v-if="(constrainFinishRepairInfo.maintenanceType == '1001' || constrainFinishRepairInfo.maintenanceType == '1003') && constrainFinishRepairInfo.choosedGoodsList.length > 0">
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        <span><vc:i18n name="使用商品" namespace="constrainFinishRepair"></vc:i18n></span>
                                    </label>
                                    <div class="col-sm-10">
                                        <div class="row">
                                            <div class="col-sm-2 text-center">
                                                <span>
                                                    <vc:i18n name="分类" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                            <div class="col-sm-2 text-center">
                                                <span>
                                                    <vc:i18n name="商品" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                            <div class="col-sm-2 text-center"
                                                 v-show="constrainFinishRepairInfo.maintenanceType == '1001'">价格
                                            </div>
                                            <div class="col-sm-2 text-center">
                                                <span>
                                                    <vc:i18n name="数量" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                <span>
                                                    <vc:i18n name="单位" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                <span>
                                                    <vc:i18n name="规格" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                            <div class="col-sm-2 text-center">
                                                <span>
                                                    <vc:i18n name="操作" namespace="constrainFinishRepair"></vc:i18n>
                                                </span>
                                            </div>
                                        </div>
                                        <div class="row" style="margin-bottom: 10px;"
                                             v-for="(item,index) in constrainFinishRepairInfo.choosedGoodsList">
                                            <div class="col-sm-2">
                                                <input cols="15" class="form-control" disabled="disabled"
                                                       v-model="item.rstName">
                                            </div>
                                            <div class="col-sm-2" v-if="item.isCustom">
                                                <input cols="15" class="form-control" disabled="disabled"
                                                       v-model="item.customGoodsName">
                                            </div>
                                            <div class="col-sm-2" v-else>
                                                <input cols="15" class="form-control" disabled="disabled"
                                                       v-model="item.resName">
                                            </div>
                                            <div class="col-sm-2"
                                                 v-show="constrainFinishRepairInfo.maintenanceType == '1001'">
                                                <input cols="15" class="form-control"
                                                       :disabled="!item.isCustom && item.outHighPrice == item.outLowPrice"
                                                       v-model="item.price" v-on:input="_updateTotalPrice()">
                                                <span v-show="!item.isCustom && item.outHighPrice != item.outLowPrice">
                                                    <span>
                                                        <vc:i18n name="价格范围" namespace="constrainFinishRepair">
                                                        </vc:i18n>
                                                    </span>({{item.outLowPrice}} - {{item.outHighPrice}})
                                                </span>
                                            </div>
                                            <div class="col-sm-2">
                                                <div class="input-group">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-primary" type="button"
                                                                v-on:click="_useNumberDec(index)">-</button>
                                                    </span>
                                                    <input cols="15" class="form-control" v-model="item.useNumber"
                                                           v-on:input="_updateTotalPrice()">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-primary" type="button"
                                                                v-on:click="_useNumberInc(index)">+</button>
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                {{item.miniUnitCodeName ? item.miniUnitCodeName : '-'}}
                                            </div>
                                            <div class="col-sm-1 text-center">
                                                {{item.specName ? item.specName : '-'}}
                                            </div>
                                            <div class="col-sm-2 text-center">
                                                <button class="btn btn-danger" type="button"
                                                        v-on:click="_removeChoosedGoodsItem(index)">
                                                    <i class="fa fa-times"></i>&nbsp;移除
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group row" v-if="constrainFinishRepairInfo.maintenanceType == '1001'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="商品总金额" namespace="constrainFinishRepair"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <input cols="15" class="form-control" disabled="disabled"
                                           v-model="constrainFinishRepairInfo.totalPrice">
                                </div>
                            </div>
                            <div class="row form-group" v-if="constrainFinishRepairInfo.maintenanceType == '1001'">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="支付方式" namespace="constrainFinishRepair"></vc:i18n></span>:
                                </label>
                                <div class="col-sm-9">
                                    <select class="custom-select" v-model="constrainFinishRepairInfo.payType">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填','constrainFinishRepair')}}，请选择支付方式
                                        </option>
                                        <option v-for="(item,index) in constrainFinishRepairInfo.payTypes" :key="index"
                                                :value="item.statusCd">{{item.name}}
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="处理意见" namespace="constrainFinishRepair"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <textarea :placeholder="vc.i18n('必填，请填写处理意见','constrainFinishRepair')" cols="15"
                                              class="form-control" v-model="constrainFinishRepairInfo.context">
                                    </textarea>
                                </div>
                            </div>
                            <div class="ibox-content">
                                <button class="btn btn-primary float-right" type="button"
                                        v-on:click="_constrainFinishRepairInfo()">
                                    <i class="fa fa-check"></i>&nbsp;提交
                                </button>
                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                        v-on:click="_back()">
                                    <i class="fa fa-close"></i>&nbsp;返回
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <vc:create path="common/chooseSingleResource" emitChooseSingleResource="constrainFinishRepairInfo"
               emitLoadData="constrainFinishRepairInfo">
    </vc:create>
</div>